﻿using System.Windows.Documents;
using System.Windows.Input;

namespace BlazeNotes.Core.Commands.UI
{
    public class CustomCommands
    {
        private static RoutedUICommand _insertCheckBox;

        private static object _synchronize = new object();

        public static RoutedUICommand InsertCheckBox { get { return EnsureCommand(ref _insertCheckBox, "InsertCheckBox"); } }

        private static RoutedUICommand EnsureCommand(ref RoutedUICommand command, string commandPropertyName)
        {
            lock (_synchronize)
            {
                if (command == null)
                {
                    
                    InputGestureCollection collection = new InputGestureCollection();
                    collection.Add(new KeyGesture(Key.D1, ModifierKeys.Control, "Ctrl + 1"));
                    command = new RoutedUICommand(commandPropertyName, commandPropertyName, typeof(CustomCommands), collection);
                }
            }
            return command;
        }
    }
}
